package com.example.springcloud.alibaba.myhandler;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.example.springcloud.entities.CommonResult;
import org.springframework.web.bind.annotation.PathVariable;

public class CustomerBlockHandler {
    public static CommonResult handlerException(@PathVariable Long id, BlockException exception) {
        return new CommonResult(4444,"按客户自定义,global handlerException-----1");
    }
    public static CommonResult handlerException2(@PathVariable Long id, BlockException exception) {
        return new CommonResult(4444,"按客户自定义,global handlerException-----2");
    }
    public static CommonResult handlerException3(@PathVariable Long id, Throwable e) {
        return new CommonResult(4444,"java异常捕获,来自自定义异常类,内容:"+e.getMessage());
    }
}

